package com.yang.javaws;

import javax.xml.ws.Endpoint;

import org.junit.Test;

import com.yang.javaws.stub.TestServiceService;


public class Java6WebService {
	
	public static void main(String[] args) {
		//启动服务
		Endpoint.publish("http://localhost:8085/ws/TestService", new TestService());
	}
	/**
	 * 通过生成本地stub来调用webservice
	 * 命令：wsimport -p com.yang.javaws.stub -keep http://localhost:8085/ws/TestService?wsdl
	 */
	@Test
	public void testClient(){
		com.yang.javaws.stub.TestService service = (com.yang.javaws.stub.TestService) new TestServiceService().getTestServicePort();
		System.out.println(service.getInt(2));
	}
}
